﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Applee.FractCommon;
using System.Drawing;

namespace Applee.CantorFract
{
    internal class CantorRectangle : BaseShape
    {
        public const float HEIGHT = 20;
        public CantorRectangle()
        {      
            points = new PointF[5] 
                { 
                    new PointF(), 
                    new PointF(), 
                    new PointF(),
                    new PointF(), 
                    new PointF() 
                };
        }

        //#region IDrawable 成员

        //public void OnPaint(System.Windows.Forms.PaintEventArgs pe)
        //{
        //    Brush brush = new SolidBrush(mColor);
        //    pe.Graphics.FillPolygon(brush, points);
        //}

        //#endregion

        //#region IShape 成员

        //private PointF[] points = new PointF[5] 
        //{ 
        //    new PointF(), 
        //    new PointF(), 
        //    new PointF(),
        //    new PointF(), 
        //    new PointF() 
        //};

        //public PointF[] Points
        //{
        //    get { return points; }
        //    set { points = value; }
        //}

        //private Color mColor = new Color();
        //public Color Color
        //{
        //    get { return mColor; }
        //    set { mColor = value; }
        //}

        //public void MakeShape(PointF point, float fLength)
        //{
        //    points[0] = point;
        //    points[1] = new PointF(point.X + fLength, point.Y);
        //    points[2] = new PointF(point.X + fLength, point.Y + HEIGHT);
        //    points[3] = new PointF(point.X, point.Y + HEIGHT);
        //    points[4] = points[0];

        //}

        //#endregion

        public override void DoMakeShape(PointF point, float fLength)
        {
            points[0] = point;
            points[1] = new PointF(point.X + fLength, point.Y);
            points[2] = new PointF(point.X + fLength, point.Y + HEIGHT);
            points[3] = new PointF(point.X, point.Y + HEIGHT);
            points[4] = points[0];
        }
    }
}
